#!/usr/bin/env python
from config import MOGUPROXY_COM as config
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

PROXY = "http://transfer.mogumiao.com:9001"
#PROXY = "http://forward.xdaili.cn:80"

def proxy_header():

    sign = "Basic "+config.KEY

    # from xvc.spider.config import XDAILI_CN as config
    # import time

    # timestamp = str(int(time.time()))

    # string = "orderno=" + config.ORDER + "," + "secret=" + config.SECRET + "," + "timestamp=" + timestamp

    # sign = hashlib.md5(string.encode()).hexdigest().upper()

    # return {
    #     "Proxy-Authorization":"sign=" + sign + "&" + "orderno=" + config.ORDER + "&" + "timestamp=" + timestamp
    # }
    return {
        "Proxy-Authorization":sign
    }
